package com.nopay.dxdwphone.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;

import androidx.annotation.NonNull;

import com.nopay.dxdwphone.R;

public class DialogClearCallLog extends Dialog {

    public DialogClearCallLog(@NonNull Activity context) {
        super(context, R.style.MyDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_clear_call_log);

        findViewById(R.id.tv_dialog_cancel).setOnClickListener(v -> dismiss());
        findViewById(R.id.tv_dialog_confirm).setOnClickListener(v -> {
            dismiss();
            if(onClearCallLogConfirmListener != null) onClearCallLogConfirmListener.OnClearCallLogConfirm();
        });
    }

    private OnClearCallLogConfirmListener onClearCallLogConfirmListener;

    public DialogClearCallLog setOnClearCallLogConfirmListener(OnClearCallLogConfirmListener onClearCallLogConfirmListener) {
        this.onClearCallLogConfirmListener = onClearCallLogConfirmListener;
        return this;
    }

    public interface OnClearCallLogConfirmListener {

        void OnClearCallLogConfirm();
    }
}
